package com.jwater.core.manager.master.event;

import com.jwater.core.manager.common.model.JobInfo;

/**
 * @description:完成工作进程事件
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class CompleteJobEvent extends GroupEvent {
    private JobInfo jobInfo;

    public JobInfo getJobInfo() {
        return jobInfo;
    }

    public void setJobInfo(JobInfo jobInfo) {
        this.jobInfo = jobInfo;
    }

    @Override
    public String getType() {
        return GroupEvent.TYPE_COMPLETE_JOB;
    }

    @Override
    public byte[] serialize() {
        return SERIALIZE.serialize(jobInfo);
    }

    @Override
    public GroupEvent deserialize(byte[] data) {
        this.jobInfo = SERIALIZE.deserialize(data, JobInfo.class);
        return this;
    }

}
